package com.wxapp.custom.service.controller.client;
import com.wxapp.common.constant.base.IBaseController;
import com.wxapp.common.constant.pojo.vm.ResultVm;
import com.wxapp.common.constant.pojo.vo.UserVo;
import com.wxapp.common.core.annotation.User;
import com.wxapp.custom.api.pojo.vm.customVip.PVipDetailVm;
import com.wxapp.custom.api.pojo.vo.customVip.QVipEditVo;
import com.wxapp.custom.service.service.VipService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author lgl
 * @Description vip 管理类
 * @Datetime 2022/7/4 14:53
 * @Modified By
 */
@RequestMapping("/client/vip")
@Tag(name = "vip 管理类")
@RestController
@RequiredArgsConstructor
public class VipClientController extends IBaseController {
   private final VipService vipService;

    @GetMapping("/getVip")
    @Operation(summary ="得到vip")
    public ResultVm<PVipDetailVm> getVip(@Schema(hidden = true) @User UserVo userVo) {
        return vipService.getVip(userVo);
    }

    @PutMapping("/edit")
    @Operation(summary ="更新vip")
    public ResultVm<String> edit(@RequestBody QVipEditVo qEditVm, @Schema(hidden = true) @User UserVo userVo) {
        return vipService.edit(qEditVm, userVo);
    }
}
